<% # @page_title="MAC Addresses" %>
<% @mselect_macs=1 %>
<% @table = @hosts_to_mac_addresses %>
<% @action = "index" %>
<% @cont = "hosts_to_mac_addresses" %>

<%= render :partial => 'layouts/page_count' %>

<table>
<thead>
  <tr>
    <th scope="col">
      <%= sort_link("Test Area", "session_test_area") %>
      <%= filterx_icon("Remove filter on #{session[:test_area]}", session[:test_area], :test_area, {:controller => 'test_areas', :action => 'set', :id => 'all'}) %>
    </th>

    <th scope="col"><%= sort_link("IP Address", "ip_address") %>
       <%= filterx_icon("Remove filter on host", @url_params[:host_id_v], :host_id_v, {:controller => @cont}) %>
    </th>

    <th scope="col"><%= sort_link("MAC Address", "mac_address") %>
       <%= filterx_icon("Remove filter on host", @url_params[:mac_v], :mac_v, {:controller => @cont}) %>
    </th>

    <th scope="col"><%= sort_link("MAC Vendor", "mac_vendor") %>
       <%= filterx_icon("Remove filter on host", @url_params[:mac_vendor_v], :mac_vendor_v, {:controller => @cont}) %>
    </th>
  </tr>
</thead>

<tbody>
<%
odd_or_even = 0
for hosts_to_mac_addresses in @hosts_to_mac_addresses
    odd_or_even = 1 - odd_or_even
%>
  <tr class="odd<%=h odd_or_even %>">
    <td><%=h hosts_to_mac_addresses.test_area_name %>
       <%= filter_icon("Show only #{hosts_to_mac_addresses.test_area_name}", session[:test_area], {:controller => 'test_areas', :action => 'set', :id => hosts_to_mac_addresses.test_area_id}) %>
    </td>

    <td><%=link_to_host(hosts_to_mac_addresses.ip_address, {:controller => "hosts", :action => "showports", :id => hosts_to_mac_addresses.host_id}) %></td>
    <td>
       <%=h hosts_to_mac_addresses.mac_address %>
       <%= filter_icon("Show only #{hosts_to_mac_addresses.mac_address}", @url_params[:mac_v], {:controller => 'hosts_to_mac_addresses', :mac_v => hosts_to_mac_addresses.mac_address}) %>
    </td>
    <td>
       <%=h hosts_to_mac_addresses.mac_vendor %>
       <%= filter_icon("Show only #{hosts_to_mac_addresses.mac_vendor}", @url_params[:mac_vendor_v], {:controller => 'hosts_to_mac_addresses', :mac_vendor_v => hosts_to_mac_addresses.mac_vendor}) %>
    </td>
  </tr>
<% end %>
</tbody>
</table>

<%= render :partial => 'layouts/page_count' %>
